set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:WinMainCRTStartup")
add_executable(CybertronTray "")

include_directories("${CYBERTRON_PATH_SOURCE}/CoreLibrary/include")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/asio")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/gtest/include")
include_directories("${CYBERTRON_PATH_SOURCE}/Protocol/Output/cpp")

IF (WIN32)
	add_definitions(-D_WIN32_WINNT=0x0501)
	SET(CMAKE_EXE_LINKER_FLAGS     "${CMAKE_EXE_LINKER_FLAGS} /level='requireAdministrator' /uiAccess='false'")
ENDIF()

add_definitions(-DNOMINMAX)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)

file(GLOB_RECURSE srcs *.h *.hh *i *.hpp *.c *.cc *.cpp *.ico *.rc)
target_sources(CybertronTray PRIVATE ${srcs})
source_group(Source FILES ${srcs})

SetDefaultTargetProperties(CybertronTray)

target_link_libraries(CybertronTray CybertronCore)

IF (MSVC)
target_link_libraries(CybertronTray protobuf)
ELSEIF (UNIX)
target_link_libraries(CybertronTray protobuf -luuid)
ENDIF()

IF (MSVC)
	SET_PROPERTY(TARGET CybertronTray PROPERTY FOLDER "Commander")
ENDIF()
